<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
  $(function() {
    parent.$.messager.progress('close');

    $('#isOutLink').combotree({
      url : '${pageContext.request.contextPath}/content/isOutLinkComboTree',
      parentField : 'pid',
      lines : true,
      panelHeight : 'auto',
      onLoadSuccess : function() {
        parent.$.messager.progress('close');
      }
    });

    $('#status').combotree({
      url : '${pageContext.request.contextPath}/content/statusComboTree',
      parentField : 'pid',
      lines : true,
      panelHeight : 'auto',
      onLoadSuccess : function() {
        parent.$.messager.progress('close');
      }
    });

    $('#form').form({
      url : '${pageContext.request.contextPath}/content/add',
      onSubmit : function() {
        parent.$.messager.progress({
          title : '提示',
          text : '数据处理中，请稍后....'
        });
        var isValid = $(this).form('validate');
        if (!isValid) {
          parent.$.messager.progress('close');
        }
        return isValid;
      },
      success : function(result) {
      console.debug(result);
        parent.$.messager.progress('close');
        result = $.parseJSON(result);
        if (result.success) {
          parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
          parent.$.modalDialog.handler.dialog('close');
        } else {
          parent.$.messager.alert('错误', result.msg, 'error');
        }
      }
    });
  })
  
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
  <div data-options="region:'center',border:false" title="" style="overflow: hidden">
    <form id="form" method="post">

      <table class="table table-hover table-condensed">
        <tr>
          <th>标题</th>
          <td><input name="title" type="text" class="span2" /></td>
          <th>副标题</th>
          <td><input name="subTitle" type="text" class="span2" /></td>
        </tr>
        <tr>
          <th>文章作者</th>
          <td><input name="author" type="text" class="span2" /></td>
          <th>文章来源</th>
          <td><input name="source" type="text" class="span2" /></td>
        </tr>
        <tr>
          <th>是否为外链</th>
          <td><select id="isOutLink" name="isOutLink" style="width: 140px; height: 29px;"</select></td>
          <th>文章路径</th>
          <td><input name="link" type="text" class="span2" /></td>
        </tr>

        <tr>
          <th>内容</th>
          <td colspan="3"><textarea style="width: 400px; height: 70px;" name="content"
              class="easyui-validatebox" data-options="validType:['length[0,10000]']"></textarea></td>
        </tr>
        <tr>
          <th>状态</th>
          <td><select id="status" name="status" style="width: 140px; height: 29px;"></select></td>
          <th>发布时间</th>
          <td><input name="publishTimeStr" validType="numValid" type="text" placeholder="请输入日期"
            class="easyui-datebox" data-options="width:145,height:29,editable:true" editable="true"
            value=""></td>
        </tr>
        <tr>
          <th>备注</th>
          <td colspan="3"><textarea style="width: 400px; height: 70px;" name="remark"
              class="easyui-validatebox" data-options="validType:['length[0,10000]']"></textarea></td>
        </tr>
        <tr>
          <th>创建人</th>
          <td><input name="createUser" class="easyui-validatebox  span2"
            data-options="validType:['length[0,1500]']" /></td>

          <th>创建日期</th>
          <td><input name="createTimeStr" validType="numValid" type="text" placeholder="请输入日期"
            class="easyui-datebox" data-options="width:145,height:29,editable:false" editable="true"
            value=""></td>
        </tr>

        <tr>
          <th>修改人</th>
          <td><input name="updateUser" class="easyui-validatebox  span2"
            data-options="validType:['length[0,1500]']" /></td>
          <th>修改日期</th>
          <td><input name="updateTimeStr" validType="numValid" type="text" placeholder="请输入日期"
            class="easyui-datebox" data-options="width:145,height:29,editable:false"
            editable="false"></td>
        </tr>

      </table>

    </form>
  </div>
</div>